﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewTask.aspx.cs" Inherits="Task.NewTask" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Content/css/task.css" rel="stylesheet" type="text/css" />
    <script src="../Content/js/jquery.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="well well-small">
        <i class="icon-home"></i>
        <strong>新建申请</strong>
    </div>
    <div class="listTable_1">
        <div >
            <asp:Repeater ID="rpProcessCategory" runat="server" >
                <ItemTemplate>
                    <dl class="fqi" id="dlProcess<%#Eval("CategoryID")%>">
                        <dt><a href="javascript:void(0)" onclick="javascript:ShowProcess( '<%#Eval("CategoryID") %>');">
                            <img src="Content/img/<%#GetCategoryImage(Convert.ToString(Eval("CategoryName"))) %>" /></a></dt>
                        <dd>
                            <a href="#">
                                <%#Eval("CategoryName")%></a></dd>
                    </dl>
                </ItemTemplate>
            </asp:Repeater>
            <asp:Repeater ID="rpAllProcess" runat="server" OnItemDataBound="rpAllProcess_ItemDataBound">
                <ItemTemplate>
                    <ul class="tanchu" style="display:inline-block" id="ulProcess<%#Eval("CategoryID")%>">
                        <asp:Repeater ID="rpProcess" runat="server">
                            <ItemTemplate>
                                <li>
                                    <img alt="" src="Content/img/fav.jpg" onclick="changeFav(this,'');" />
                                    <a href="OpenForm.aspx?TaskID=<%#Eval("InitiateID") %>&ProcessName=<%# Server.UrlEncode(Eval("ProcessName").ToString()) %>&StepName=<%# Server.UrlEncode(Eval("ProcessName").ToString()) %>" target="_blank">
                                        <%#Eval("ProcessName")%></a></li></ItemTemplate>
                        </asp:Repeater>
                    </ul>
                </ItemTemplate>
            </asp:Repeater>
        </div>
    </div>
    <div style="display: none">
        <asp:TextBox ID="txtCurrentCategory" runat="server"></asp:TextBox>
    </div>
    <script type="text/javascript">
        var currentResourceId = "";

        $(document).ready(function () {
            ShowProcess($("#txtCurrentCategory").val());
        
        });

        function ShowProcess(resourceID) {
            if (currentResourceId == resourceID) {
                return;
            }
            $(".daiban dl").attr("class", "fqi");
            $(".tanchu").hide();
            $("#dlProcess" + resourceID).attr("class", "fqi fqicurrently");
            $("#ulProcess" + resourceID).show();
            currentResourceId = resourceID;
        }

        function changeFav(ele, resourceID) {
//            $.post("AddFavHandler.ashx",
//            { resourceID: resourceID },
//            function (result) {
//                if (result == "0") {
//                    $(ele).attr("src", "images/fav.jpg");
//                }
//                else {
//                    $(ele).attr("src", "images/fav1.jpg");
//                }
//            }
//         );
        }
   
    </script>
    </form>
</body>
</html>
